<!--
 * @Author: your name
 * @Date: 2021-08-11 11:29:52
 * @LastEditTime: 2021-08-11 13:58:33
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \briup\3-html&css\day08\06-一行多列.html
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .one div{
            width:200px;
            height:200px;
            background-color: orangered;
        }
        /* 一行两列的实现方法： */
        .one>div:first-child{
            /*1. float:left; */
            float:left; 
            /* 3.float:right */
        }
        .one>div:last-child{
                 /*1. float:left; */
                 float:right;
                 /* 第二个孩子不赋值  这样写对父元素还有支撑 */
        }
        /* 一行多列的实现方法 如果多列的某个框设置了边框内边距这些 设置Box-sizing:border-box;  多行多列记得设margin-bottom*/
        .two div{
            width:20%;
            height:100px;
            background-color: orangered;
            float:left;
            margin-left: 4%;
            margin-bottom: 20px;
        }
        .two::after{
            content:'';
            display:block;
            clear:both;
        }
    </style>
</head>
<body>
    一行两列
    <div class="one">
        <div></div>
        <div></div>
    </div>
    一行三列
    一行四列   自适应
    <div class="two">
        <div></div>
        <div></div>
        <div></div>
        <div></div>
       
    </div>
    <div class="two">
        <div></div>
        <div></div>
        <div></div>
        <div></div>
        <div></div>
        <div></div>
        <div></div>
        <div></div>
        <div></div>
        <div></div>
        <div></div>
        <div></div>
    </div>
    
</body>
</html>